package yangsw87.basic;

public class CH04_S_Q1 {
	public static void main(String args[]) {
		Song s = new Song("Dansing Queen", "ABBA", "Arrival", new String[] {
				"베니 안데르손", "비에른 울바에우스", "스틱 앤더슨" }, 1976, 7);

		s.show();
	}
}

class Song {
	String title;
	String artist;
	String album;
	String composer[];
	int year;
	int track;

//	public Song() {
//		title = null;
//		artist = null;
//		album = null;
//		composer = null;
//		year = 0;
//		track = 0;
//	}

	public Song(String title, String artist, String album, String composer[],
			int year, int track) {
		this.title = title;
		this.artist = artist;
		this.album = album;
		this.composer = composer;
		this.year = year;
		this.track = track;
	}

	void show() {

		System.out.println("제목:" + title);
		System.out.println("제목:" + artist);
		System.out.println("제목:" + album);
		System.out.print("작곡가:");
		for (int i = 0; i < composer.length; i++) {
			if (i + 1 == composer.length)
				System.out.println(composer[i]);
			else
				System.out.print(composer[i] + " , ");

		}
		System.out.println("연도:" + year);
		System.out.println("트랙번호:" + track);

	}

}
